package com.shujia.flink.tf;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class Demo7Union {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        DataStream<String> ds1 = env.readTextFile("flink/data/words.txt");
        DataStream<String> ds2 = env.readTextFile("flink/data/word");

        //合并两个ds
        DataStream<String> union = ds1.union(ds2);

        union.print();

        env.execute();

    }
}
